package multistate;

public class Student {

    private String name;
    private int age;
    private String gender;

    public Student() {
        this("无名", 0, "未知");
    }

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    // 重写Object类的方法，目的是提供对象的字符串描述。
    // 简化对象信息的展示，提供更友好的格式。
    @Override // 该注解帮助检查是否正在重写父类的方法。
    public String toString() {
        return "姓名：" + name + "\n年龄：" + age + "\n性别：" + gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
